package jbl.action;
import jbl.pageModel.Kf;
import jbl.service.KfServiceI;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;
/**
 * 
 * @author jblcxg
 * 
 * 库房信息管理
 *
 */
@Namespace("/")
@Action(value="kfAction")
public class KfAction extends BaseAction implements ModelDriven<Kf>{
	private Kf kf=new Kf();
	
	private KfServiceI kfService;
	
	@Autowired
	public void setKfService(KfServiceI kfService) {
		this.kfService = kfService;
	}
	
	@Override
	public Kf getModel() {
		return kf;
	}
	/**
	 * 返回DataGrid
	 */
	public void dataGrid(){
		writeJson(kfService.dataGrid(kf));
	}
	/**
	 * 添加库房
	 */
	public void add(){
		writeJson(kfService.add(kf));
	}
	/**
	 * 修改库房
	 */
	public void edit(){
		writeJson(kfService.update(kf));
	}
	/**
	 * 库房下拉列表值
	 */
	public void comboboxInfo(){
		writeJson(kfService.comboboxInfo());
	}
}
